package com.itcast.mapper;

import com.itcast.domain.User;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/*注解方式实现*/
public interface UserMapperTwo {


    @Select("select * from user")
    @Results(id = "userMap", value = {
            /*       id 封装主键自增      column 封装数据库列   property 封装实体类对象*/
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "username",property = "username"),
            @Result(column = "birthday",property = "birthday"),
            @Result(column = "sex",property = "sex"),
            @Result(column = "address",property = "address")

    })
    List<User> findAll();




}
